﻿using Delonix_Regia_Hotel.Class;
using DelonixRegia__Staff_Use_.Classes;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace DelonixRegia__Staff_Use_
{
    public partial class Particulars : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {

            Label8.Text = Request.QueryString["name"];
            if (Label8.Text == "")
            {
                Response.Redirect("Login.aspx");
            }
            StaffLogin s = new StaffLogin();
            s = StaffLogin.GetAccounttypeByUsername(Label8.Text);
            Label11.Text = s.Accounttype;
            if (Label11.Text == "admin")
            {
                Label10.Visible = true;
                LinkButton5.Visible = true;
                Label9.Visible = true;
                LinkButton4.Visible = true;
            }
            
        }

        protected void Button1_Click(object sender, EventArgs e)
        {
            DataList1.DataSource = Guest.GetGuestsByic(TextBox3.Text);
            DataList1.DataBind();
        }

        protected void LinkButton2_Click(object sender, EventArgs e)
        {
            Response.Redirect("StaffWorkTime.aspx?name=" + Label8.Text);
        }

        protected void LinkButton1_Click(object sender, EventArgs e)
        {
            Response.Redirect("Particulars.aspx?name=" + Label8.Text);
        }

        protected void LinkButton3_Click(object sender, EventArgs e)
        {
            Response.Redirect("StaffUpdate.aspx?name=" + Label8.Text);
        }

        protected void LinkButton4_Click(object sender, EventArgs e)
        {
            Response.Redirect("CreateStaffAccount.aspx?name=" + Label8.Text);
        }

        protected void LinkButton6_Click(object sender, EventArgs e)
        {
            Response.Redirect("CancelBooking.aspx?name=" + Label8.Text);
        }

        protected void LinkButton5_Click(object sender, EventArgs e)
        {
            Response.Redirect("DeleteStaff.aspx?name=" + Label8.Text);
        }
    }
}